function DialogAddPurchase(doc, container, width, height, user, date, options, data) {
  this._doc = doc;
  this._container = container;
  this._width = (width) ? width : 500;
  this._height = (height) ? height : 100;
  this._user = user;
  this._date = date;
  this._options = options;
  this._data = data;
  this._unique = MiscUtils.unique();
  this._createElements();
  this._gui = AbsDialogAddPurchase.gui(this._unique);
};

DialogAddPurchase.prototype._createElements = function() {
  var table, tr, td;
  
  table = document.createElement('table');
  table.cellPadding = 0;
  table.cellSpacing = 0;
  table.style.width = this._width + 'px';
  table.style.height = this._height + 'px';
  table.style.marginTop = '10px';
  this._container.appendChild(table);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '130px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Branch'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var br = document.createElement("select");
  br.id = this._unique + '_branch_select';
  br.style.width = '255px';
  br.style.height = '22px';
  td.appendChild(br);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Bride Name'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'text', '', null);
  dlinput.style.width = '250px';
  dlinput.id = this._unique + '_bname_text';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Groom Name'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'text', '', null);
  dlinput.style.width = '250px';
  dlinput.id = this._unique + '_gname_text';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Is Wedding'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.padding = '0';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'checkbox', '', null);
  dlinput.id = this._unique + '_iswedding_checkbox';
  dlinput.style.marginLeft = '0';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Wedding Date'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'text', '', null);
  dlinput.style.width = '250px';
  dlinput.id = this._unique + '_weddingdate_text';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Culture1'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '235px';
  var br = document.createElement("select");
  br.id = this._unique + '_culture1_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_culture1';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Culture2'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_culture2_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_culture2';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Ceremony'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_ceremony_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_ceremony';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Reception'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_reception_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_reception';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Wedding Color'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_weddingcolor_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_color';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Customer No.'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var cninput = DOMUtils.createInput('', '', 'text', '', null);
  cninput.style.width = '250px';
  cninput.id = this._unique + '_cusNumber_text';
  td.appendChild(cninput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('quantity'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'text', '', null);
  dlinput.style.width = '250px';
  dlinput.id = this._unique + '_quantity_text';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Photographer'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var input2 = document.createElement("select");
  input2.id = this._unique + '_photographer_select';
  input2.style.width = '255px';
  input2.style.height = '22px';
  td.appendChild(input2);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('2nd Photographer'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var input2 = document.createElement("select");
  input2.id = this._unique + '_photographer2_select';
  input2.style.width = '255px';
  input2.style.height = '22px';
  td.appendChild(input2);
};